﻿/**	@file		regx.h
 *	@date		(2007-06-10 11:33:28)/(2008-02-29 20:55:37)
 *-----------------------------------------------------------------------------
 *	@version	1.0.5.6
 *	@author		Nick Shallery	(nicknide@gmail.com)
 *	@copyright	YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.
 *-----------------------------------------------------------------------------
**/


#if			!defined(__LXUT__ALICE__REGX__NICK__K_IN_G__)
#define		__LXUT__ALICE__REGX__NICK__K_IN_G__
//==============================================================================
//--------------------------------------------------------------------------

#include	"../../lolix/lolix_macro.h"
#include	"../../lolix/lolix_type.h"


namespace lxut{namespace alice{

class	LOLIX_NO_VTABLE	regx
	: public ::lolix::itf
{
public:
	LOLIX_DECLARE_ITF(lxut::alice::regx, lolix::itf, (0xf6a2a7fd, 0x7921425b, 0x96e26094, 0xcd983c6f));
	LOLIX_DEFINE_FACTORY((0x903685d2, 0x84c982d2, 0x80db04aa, 0x52609901), (regx**));
	struct	regx_token_info;
	class LOLIX_NO_VTABLE	regx_cmd;
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	clear_cmd(void)										= 0;
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	push_cmd(const unsigned char* cmd_str, size_type cmd_size,regx_cmd* pcmd)		= 0;
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	rebuild_cmd_table(void)								= 0;
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	set_src(const unsigned char* src_begin, const unsigned char* src_end)	= 0;
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	trans_src(void)										= 0;
};


#pragma	pack(push, 8)
struct	regx::regx_token_info
{	//	匹配状态集
	const unsigned char* io_begin	;	//	当前扫描到的位置
	const unsigned char* io_cmd_begin;	//	当前命令的起始处
	const unsigned char* io_cmd_end	;	//	当前命令的结尾
	const unsigned char* in_cmd_now	;	//	当前命令匹配的起始位置
	const unsigned char* in_cmd_last	;	//	上次命令的位置
};
#pragma	pack(pop)

class LOLIX_NO_VTABLE	regx::regx_cmd
	: public ::lolix::itf
{
public:
	LOLIX_DECLARE_ITF(lxut::alice::regx::regx_cmd, lolix::itf, (0xbeee1818, 0x888b4709, 0xb12089b6, 0x1192c168));
	virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	invoke(regx* in, regx_token_info* inf)				= 0;
};


}}



//--------------------------------------------------------------------------
//==============================================================================
#endif	//	!defined(__LXUT__ALICE__REGX__NICK__K_IN_G__)

